.class public Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainIndexer;
.super Ljava/lang/Object;
.source "MonotoneChainIndexer.java"


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 71
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private findChainEnd([Lcom/vividsolutions/jts/geom/Coordinate;I)I
    .locals 3

    .line 96
    aget-object v0, p1, p2

    add-int/lit8 p2, p2, 0x1

    aget-object v1, p1, p2

    invoke-static {v0, v1}, Lcom/vividsolutions/jts/geomgraph/Quadrant;->quadrant(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)I

    move-result v0

    .line 98
    :goto_0
    array-length v1, p1

    if-ge p2, v1, :cond_1

    add-int/lit8 v1, p2, -0x1

    .line 100
    aget-object v1, p1, v1

    aget-object v2, p1, p2

    invoke-static {v1, v2}, Lcom/vividsolutions/jts/geomgraph/Quadrant;->quadrant(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)I

    move-result v1

    if-eq v1, v0, :cond_0

    goto :goto_1

    :cond_0
    add-int/lit8 p2, p2, 0x1

    goto :goto_0

    :cond_1
    :goto_1
    add-int/lit8 p2, p2, -0x1

    return p2
.end method

.method public static toIntArray(Ljava/util/List;)[I
    .locals 3

    .line 64
    invoke-interface {p0}, Ljava/util/List;->size()I

    move-result v0

    new-array v0, v0, [I

    const/4 v1, 0x0

    .line 65
    :goto_0
    array-length v2, v0

    if-ge v1, v2, :cond_0

    .line 66
    invoke-interface {p0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/Integer;

    invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I

    move-result v2

    aput v2, v0, v1

    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_0
    return-object v0
.end method


# virtual methods
.method public getChainStartIndices([Lcom/vividsolutions/jts/geom/Coordinate;)[I
    .locals 3

    .line 78
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 79
    new-instance v1, Ljava/lang/Integer;

    const/4 v2, 0x0

    invoke-direct {v1, v2}, Ljava/lang/Integer;-><init>(I)V

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 81
    :cond_0
    invoke-direct {p0, p1, v2}, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainIndexer;->findChainEnd([Lcom/vividsolutions/jts/geom/Coordinate;I)I

    move-result v2

    .line 82
    new-instance v1, Ljava/lang/Integer;

    invoke-direct {v1, v2}, Ljava/lang/Integer;-><init>(I)V

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 84
    array-length v1, p1

    add-int/lit8 v1, v1, -0x1

    if-lt v2, v1, :cond_0

    .line 86
    invoke-static {v0}, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainIndexer;->toIntArray(Ljava/util/List;)[I

    move-result-object p1

    return-object p1
.end method
